package threadcreatedway;

import java.util.concurrent.TimeUnit;

public class Main {


    public static void main(String[] args) {

        new MyThread().start();

        new MyThread().start();

        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + i);

        }

        MyThread myThread = new MyThread();

        String name = myThread.getName();

        System.out.println(name);

        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

}
